﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ECare.Client.templates
{
    public partial class frmInfo : DevExpress.XtraEditors.XtraForm{
        public frmInfo()
        {
            InitializeComponent();

            
        }
        private object _entity = null;
        public object entity
        {
            get { return _entity; }
            set
            {
                this._entity = value;

                this.LoadInfor();
            }
        }

        public virtual void LoadInfor()
        {

        }

        public frmLoading frmloading = null;

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }


        public bool ValidateTextControl(TextBox control)
        {
            if (string.IsNullOrEmpty(control.Text))
            {
                this.errorProvider1.SetError(control, "?");
                return false;
            }
            else
            {
                this.errorProvider1.SetError(control, "");
                return true;
            }
        }

        public bool ValidateDropdownlist(ComboBox control)
        {
            if (control.SelectedValue == null)
            {
                this.errorProvider1.SetError(control, "?");
                return false;
            }
            else
            {
                this.errorProvider1.SetError(control, "");
                return true;
            }
        }

    }

    public delegate void EntitySavedHandler(object entity);
}
